import 'package:flutter_riverpod/flutter_riverpod.dart';

class NavigationNotifier extends StateNotifier<int> {
  NavigationNotifier() : super(0);

  void switchToTab(int tabIndex) {
    if (state != tabIndex) {
      state = tabIndex;
    }
  }

  void switchToMessageTab() {
    switchToTab(2);
  }

  void switchToHomeTab() {
    switchToTab(0);
  }

  void switchToCommunityTab() {
    switchToTab(1);
  }

  void switchToProfileTab() {
    switchToTab(3);
  }
}

final navigationProvider = StateNotifierProvider<NavigationNotifier, int>((
  ref,
) {
  return NavigationNotifier();
});
